<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link th:href="@{/static/assets/images/logo.png}" rel="icon">
    <title>希米奥后台管理系统</title>
    <link rel="stylesheet" th:href="@{/static/assets/libs/layui/css/layui.css}"/>
    <link rel="stylesheet" th:href="@{/static/assets/himio/font-awesome.min.css}"/>
    <link rel="stylesheet" th:href="@{/static/assets/module/admin.css}"/>
    <link rel="stylesheet" th:href="@{/static/assets/himio/himio-theme.css}"/>
    <link rel="stylesheet" th:href="@{/static/assets/system/css/index.css}"/>
    <!--[if lt IE 9]>
    <script th:src="@{/static/assets/js/html5shiv.min.js}"></script>
    <script th:src="@{/static/assets/js/respond.min.js}"></script>
    <![endif]-->
</head>
<!-- th:classappend="${globalAttr.sideTheme ne null ? globalAttr.sideTheme : ''}"-->
<body class="layui-layout-body theme-himio">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header">
        <div class="layui-logo">
            <img src="/static/assets/images/logo.png"/>
            <cite th:utext="${'&nbsp;'+@config.getKey('sys.logo.name')}"></cite>
        </div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a>
                    <img th:src="(${#strings.isEmpty(user.avatar)}) ? @{/static/assets/images/head.jpg} : @{${user.avatar}}" class="layui-nav-img">
                    <cite>[[${user.userName}]]</cite>
                </a>
                <dl class="layui-nav-child" lay-unselect>
                    <dd lay-unselect><a ew-href="/system/profile">个人中心</a></dd>
                    <dd lay-unselect><a ew-event="open" data-type="1" data-content="#pwdDialog">修改密码</a></dd>
                    <hr>
                    <dd lay-unselect><a ew-event="logout" th:data-url="@{logout}">退出</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="open" data-type="0" data-content="#aboutDialog" data-area="320px,215px"><i class="layui-icon layui-icon-more-vertical"></i></a>
            </li>
        </ul>
    </div>

    <!-- 侧边栏 -->
    <div class="layui-side">
        <div class="layui-side-scroll">
            <!-- 系统菜单 -->
            <ul class="layui-nav layui-nav-tree" lay-filter="admin-side-nav" style="margin: 15px 0;" lay-shrink="_all">
                <!-- 一级菜单 -->
                <th:block th:each="menu : ${menus}">
                    <!--一级菜单没有子菜单，说明不是一个目录，可能是超链接或者就是一个菜单-->
                    <th:block th:if="${#lists.isEmpty(menu.children)}">
                        <th:block th:if="${!#strings.isEmpty(menu.target) && menu.target == 'menuBlank'} ">
                            <li class="layui-nav-item">
                                <a th:href="${menu.url}" target="_blank"><i th:class="${menu.icon ne null ? menu.icon : 'fa fa-navicon'}"></i><cite>[[${menu.menuName}]]</cite></a>
                            </li>
                        </th:block>
                        <th:block th:if="${#strings.isEmpty(menu.target) && menu.target == 'menuItem'} ">
                            <li class="layui-nav-item">
                                <a th:lay-href="${menu.url}"><i th:class="${menu.icon ne null ? menu.icon : 'fa fa-navicon'}"></i><cite>[[${menu.menuName}]]</cite></a>
                            </li>
                        </th:block>
                        <th:block th:if="${#strings.isEmpty(menu.target) && menu.target == 'menuInner'} ">
                            <li class="layui-nav-item">
                                <a th:lay-href="${menu.url}" class="layui-hide"><i th:class="${menu.icon ne null ? menu.icon : 'fa fa-navicon'}"></i><cite>[[${menu.menuName}]]</cite></a>
                            </li>
                        </th:block>
                    </th:block>
                    <!--一级菜单有子菜单，说明是一个目录-->
                    <th:block th:if="${not #lists.isEmpty(menu.children)}">
                        <li class="layui-nav-item">
                            <a><i th:class="${menu.icon ne null ? menu.icon : 'fa fa-navicon'}"></i><cite>[[${menu.menuName}]]</cite></a>
                            <!--循环有一级菜单的子菜单（二级菜单）-->
                            <dl class="layui-nav-child">
                                <th:block th:each="cmenu:${menu.children}">
                                    <!--二级菜单没有子菜单，说明就是一个菜单或者是一个超链接-->
                                    <th:block th:if="${#lists.isEmpty(cmenu.children)}">
                                        <th:block th:if="${cmenu.url ne '/system/main'}">
                                            <th:block th:if="${!#strings.isEmpty(cmenu.target) && cmenu.target == 'menuBlank'} ">
                                                <dd><a th:href="${cmenu.url}" target="_blank"><i th:class="${cmenu.icon ne null ? cmenu.icon : 'fa fa-navicon'}"></i>[[${cmenu.menuName}]]</a></dd>
                                            </th:block>
                                            <th:block th:if="${!#strings.isEmpty(cmenu.target) && cmenu.target == 'menuItem'} ">
                                                <dd><a th:lay-href="${cmenu.url}"><i th:class="${cmenu.icon ne null ? cmenu.icon : 'fa fa-navicon'}"></i>[[${cmenu.menuName}]]</a></dd>
                                            </th:block>
                                            <th:block th:if="${!#strings.isEmpty(cmenu.target) && cmenu.target == 'menuItem'} ">
                                                <dd class="layui-hide"><a th:lay-href="${cmenu.url}"><i th:class="${cmenu.icon ne null ? cmenu.icon : 'fa fa-navicon'}"></i>[[${cmenu.menuName}]]</a></dd>
                                            </th:block>
                                        </th:block>
                                    </th:block>
                                    <!--二级菜单有子菜单，说明是一个目录-->
                                    <th:block th:if="${not #lists.isEmpty(cmenu.children)}">
                                        <dd>
                                            <a><i th:class="${cmenu.icon ne null ? cmenu.icon : 'fa fa-navicon'}"></i>[[${cmenu.menuName}]]</a>
                                            <dl class="layui-nav-child">
                                                <!--循环三级菜单，目前最多支持三级-->
                                                <th:block th:each="emenu:${cmenu.children}">
                                                    <th:block th:if="${!#strings.isEmpty(emenu.target) && emenu.target == 'menuBlank'} ">
                                                        <dd><a th:href="${emenu.url}" target="_blank"><i th:class="${emenu.icon ne null ? emenu.icon : 'fa fa-navicon'}"></i>[[${emenu.menuName}]]</a>
                                                        </dd>
                                                    </th:block>
                                                    <th:block th:if="${!#strings.isEmpty(emenu.target) && emenu.target == 'menuItem'} ">
                                                        <dd><a th:lay-href="${emenu.url}"><i th:class="${emenu.icon ne null ? emenu.icon : 'fa fa-navicon'}"></i>[[${emenu.menuName}]]</a></dd>
                                                    </th:block>
                                                    <th:block th:if="${!#strings.isEmpty(emenu.target) && emenu.target == 'menuInner'} ">
                                                        <dd class="layui-hide"><a th:lay-href="${emenu.url}"><i th:class="${emenu.icon ne null ? emenu.icon : 'fa fa-navicon'}"></i>[[${emenu.menuName}]]</a>
                                                        </dd>
                                                    </th:block>
                                                </th:block>
                                            </dl>
                                        </dd>
                                    </th:block>
                                </th:block>
                            </dl>
                        </li>
                    </th:block>
                </th:block>
            </ul>
        </div>
    </div>

    <!-- 主体部分 -->
    <div class="layui-body"></div>
    <!-- 底部 -->
    <div class="layui-footer text-right" th:if="${ignoreFooter ne 'true'}">Copyright © [[${copyrightYear}]]  All rights reserved.<a href="https://beian.miit.gov.cn/" target="_blank">赣ICP备15003721号-6</a></div>
</div>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!--修改密码弹框-->
<script type="text/html" id="pwdDialog">
    <!-- 修改密码表单 -->
    <form class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">原始密码:</label>
            <div class="layui-input-block">
                <input type="password" name="oldPassword" placeholder="请输入原始密码" class="layui-input"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item" th:with="chrtype=${@config.getKey('sys.account.chrtype')}">
            <label class="layui-form-label layui-form-required">新密码
                <th:block th:if="${chrtype != '0'}">
                    <span class="help-block m-b-none">
                        <th:block th:if="${chrtype == '1'}"><i lay-tips="密码只能为0-9数字" class="fa fa-info-circle"></i></th:block>
                        <th:block th:if="${chrtype == '2'}"><i lay-tips="密码只能为a-z和A-Z字母" class="fa fa-info-circle"></i></th:block>
                        <th:block th:if="${chrtype == '3'}"><i lay-tips="密码必须包含（字母，数字）" class="fa fa-info-circle"></i></th:block>
                        <th:block th:if="${chrtype == '4'}"><i lay-tips="密码必须包含（字母，数字，特殊字符!@#$%^&*()-=_+）" class="fa fa-info-circle"></i></th:block>
                    </span>
                </th:block>
                :</label>
            <div class="layui-input-block">
                <input type="password" name="newPassword" placeholder="请输入新密码" class="layui-input"
                       lay-verType="tips" lay-verify="required|psw" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">确认密码:</label>
            <div class="layui-input-block">
                <input type="password" name="rePsw" placeholder="请再次输入新密码" class="layui-input"
                       lay-verType="tips" lay-verify="required|equalTo" lay-equalTo="input[name=newPassword]" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block text-right">
                <button class="layui-btn" lay-filter="submit-psw" lay-submit>保存</button>
                <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
            </div>
        </div>
    </form>
</script>
<!--关于弹框-->
<script type="text/html" id="aboutDialog">
    <div>
        <p>项目框架：Himio Admin</p>
        <p>当前版本：[[${curVersion}]]</p>
        <p>获取源码：<a href="https://gitee.com/miyakowork/HimioAdmin" target="_blank">点我前往</a></p>
    </div>
</script>

<!-- js部分 -->
<th:block th:include="include :: footer"/>
<script th:src="@{/static/assets/system/js/indexHome.js}"></script>
<script th:inline="javascript">
    var type = [[${#strings.defaultString(@config.getKey('sys.account.chrtype'), 0)}]];
    var sideTheme = [[${sideTheme}]];
    var isDefaultModifyPwd = [[${isDefaultModifyPwd}]];
    var isPasswordExpired = [[${isPasswordExpired}]];
    var latest5Notices = [[${latest5Notices}]];
</script>
</body>
</html>